﻿namespace LM.Repositorios.Maps
{
    using LM.Negocio;
    using System.ComponentModel.DataAnnotations.Schema;
    using System.Data.Entity.ModelConfiguration;

    public class GaragemMap : EntityTypeConfiguration<Garagem>
    {
        public GaragemMap()
        {            
            this.Property(m => m.Id).HasDatabaseGeneratedOption(DatabaseGeneratedOption.Identity).HasColumnName("Id");
            this.Property(m => m.Codigo).HasColumnName("Codigo").IsRequired();
            this.Property(m => m.Nome).HasColumnName("Nome").IsRequired().HasMaxLength(100);
            this.Property(m => m.CNPJ).HasColumnName("CNPJ").IsRequired().HasMaxLength(18);
            this.Property(m => m.InscricaoMunicipal).HasColumnName("InscricaoMunicipal").IsRequired().HasMaxLength(40);

            this.HasKey(m => m.Codigo);

            this.ToTable("GARAGEM");
        }
    }
}
